<header class="main-header">
    <a href="../../index2.html" class="logo">
        <span class="logo-mini">CRM</span>
        <span class="logo-lg"><b>叩丁狼客户管理系统</b></span>
    </a>
    <!-- Header Navbar: style can be found in header.less -->
    <nav class="navbar navbar-static-top">
        <!-- Sidebar toggle button-->
        <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </a>

        <div class="navbar-custom-menu" id="userInfo" data-userinfo="<@shiro.principal />">
            <ul class="nav navbar-nav">
                <li class="dropdown user user-menu">
                    <#--登陆者头像与名字-->
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        <img src="/js/adminlte/img/user2-160x160.jpg" class="user-image" alt="User Image">
                        <span class="hidden-xs"><@shiro.principal property="name" /></span>
                    </a>
                    <ul class="dropdown-menu-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close" style="min-width: 100px;">
                        <li>
                            <a href="javascript:;" id="upAdmin">
                                <i class="fa fa-cog" ></i>
                                升级超管
                            </a>
                        </li>
                        <li class="divider"></li>
                        <li>
                            <a href="/employee/input.do?id=<@shiro.principal property="id" />">
                                <i class=" fa fa-user"></i>
                                个人信息
                            </a>
                        </li>
                        <#-- 修改密码栏 -->
                        <li class="divider"></li>
                        <li>
                            <a href="/employee/editPassword.do">
                                <i class=" fa fa-unlock-alt"></i>
                                修改密码
                            </a>
                        </li>
                        <#-- 刷新当前权限 -->
                        <#--<li class="divider"></li>
                        <li>
                            <a href="javascript:;" id="refreshSelfPermisson">
                                <i class=" fa fa-refresh"></i>
                                刷新权限
                            </a>
                        </li>-->
                        <#--&lt;#&ndash; 刷新登录 &ndash;&gt;
                        <li class="divider"></li>
                        <li>
                            <a href="javascript:;" id="refreshLogin">
                                <i class=" fa fa-refresh"></i>
                                刷新登录
                            </a>
                        </li>-->
                        <li class="divider"></li>
                        <li>
                            <#--<a href="javascript:;" id="logout">
                                <i class="fa fa-power-off"></i>
                                注销
                            </a>-->
                            <#-- shiro 注销-->
                            <a href="/logout.do" >
                                <i class="fa fa-power-off"></i>
                                注销
                            </a>
                        </li>
                    </ul>
                </li>

            </ul>
        </div>
    </nav>

    <script>
        $(function () {
            //注销按钮
            $('#logout').on('click', function () {
               $.post('/logout.do',function (data) {
                   checkData(data, '/login.html');
               });
            });

            /*//刷新权限按钮
            $('#refreshSelfPermisson').on('click', function () {
                $.post('/permission/refreshSelfPermisson.do',function (data) {
                    checkData(data);
                });
            });*/

            //升级高管按钮
            var id = <@shiro.principal property='id' />;
            $('#upAdmin').on('click', function () {
                /*$.messager.confirm("警告", "你确定要升级为超级管理员？", function () {
                    $.post('/employee/upAdmin.do',{id:id,admin:true},function (data) {
                        checkData(data);
                    });
                });*/
                $('#editModalUpAdmin').modal('show');

            });
            $('#btn_submit_upAdmin').click(function () {
                $('#editFormUpAdmin').ajaxSubmit(function (data) {
                    checkData(data, null, "升级成功！");
                });
            });

        });
    </script>
</header>

<#--升级高管的确认模态框-->
<div class="modal fade" id="editModalUpAdmin">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" style="color: red;">警告：你确定升级为高管？</h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" action="/employee/upAdmin.do" method="post" id="editFormUpAdmin">

                    <#--隐藏域-->
                    <input name="id" value="<@shiro.principal property='id' />" type="hidden" />
                    <input name="admin" value="true" type="hidden" />

                    <div class="form-group" >
                        <label  class="col-sm-3 control-label">请输入密文：</label>
                        <div class="col-sm-6">
                            <input type="password" class="form-control" name="tokenPassword" placeholder="需要密文才可以升级为超级管理员">
                        </div>
                    </div>


                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" id="btn_submit_upAdmin">确定</button>
                <button type="button" class="btn btn-default" data-dismiss="modal" >取消</button>
            </div>
        </div>
    </div>
</div>